package pl.eurobank.dev.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.SequenceGenerator;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

@Entity
@Table(name = "client")
public class Client {

	private int id;
	private String userName;
	private String password;
	private String realName;
	private float accountAmount;

	@SequenceGenerator(name = "client_seq", sequenceName = "client_seq")
	@Id
	@GeneratedValue(generator = "client_seq")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "username", nullable = false, length = 60)
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "password", nullable = false, length = 60)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "real_name", nullable = false, length = 80)
	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	@Column(name = "account_amount", nullable = false)
	public float getAccountAmount() {
		return accountAmount;
	}

	public void setAccountAmount(float accountAmount) {
		this.accountAmount = accountAmount;
	}

	private Set<ClientHasInvestFundUnit> ClientHasInvestFundUnit = new HashSet<ClientHasInvestFundUnit>(0);

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "client")
	public Set<ClientHasInvestFundUnit> getClientHasInvestFundUnit() {
		return this.ClientHasInvestFundUnit;
	}
 
	public void setClientHasInvestFundUnit(Set<ClientHasInvestFundUnit> ClientHasInvestFundUnit) {
		this.ClientHasInvestFundUnit = ClientHasInvestFundUnit;
	}
	
}
